package chapter1.thread.account_Lock;

/**
 * @author oldliu
 * @since 1.0
 */
public class Account {
    private String acno;    //银行卡号
    private int money;//账户和余额

    public Account() {
    }

    public Account(String acno, int money) {
        this.acno = acno;
        this.money = money;
    }

    //取钱
    public void takeAway(int q) {
        this.money -= q;
    }

    //存钱
    public void deposit(int q) {
        this.money += q;
    }

    public String getAcno() {
        return acno;
    }

    public void setAcno(String acno) {
        this.acno = acno;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }
}
